var fNumber = $("#fNumber").val();
/*
 * @Description: 预加载
 * @param : 
 */
$(function (){
//	console.log(data)
	$.ajax({
		url:pathUrl("emp/findByCondition.action"),
		type:'GET',
		dataType:'JSON',
		data:{'fNumber':fNumber},
		success:function(data){
//			console.log(data)
			var str = "";
			data = data.rows[0];
			str = toUtf8(data.fNumber);
			$("#fName").text(data.fName);
			
			$("#qrcode").qrcode({
				width: 110,
				height: 110,
				correctLevel : 3,
				text: str
			});
			setTimeout(function(){
				print();
			}, 500);
		}
	});
});

/*
 * @Description: 打印
 * @param :
 */
function print() {
	var canvas=document.getElementsByTagName("canvas")[0];
	var dataURL = canvas.toDataURL("image/png");
	var img = '<img src="'+dataURL+'"></img>';
	$("#qrcode").html(img);
	$(".row").print({
		deferred: $.Deferred().done(function() { 
			window.close(); 
		})//打印完后自动关闭打印页面
	});
}